<?php
namespace app\common\behavior;
use think\Request;
use think\Lang;
class module
{
	public function run(&$params) {
		$language = input("language") ?: Lang::detect();
		Lang::load(APP_PATH . 'common/lang/'.$language.'.php');
		$dirs = scandir(APP_PATH);
		foreach ($dirs as $name) {
			$path = APP_PATH.$name;
	        if ($name === '.' or $name === '..' or $name === 'common' or $name === 'extra' or !is_dir($path)) continue;
	        $file = $path. DS .'hook.php';
	        if(is_file($file) and file_exists($file)) \think\Hook::import(include $file);
		}
	}
}